package hardBD;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;


public class AudioLoaderV2 {
	
	
	public AudioLoaderV2(){
		
	}
	
	public static byte[] load(String path){
		Path filePath = Paths.get(path);
		byte[] t = null;
		try {
			t = Files.readAllBytes(filePath);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		/*for(byte b : t){
			System.out.println(b);
		}*/
		return t;
	}
	
	public byte[] load60(){
		int counter = 0;
		boolean ct = false;
		
		byte[] result = new byte[1024*43*15];
		result[0] = 100;
		
		for(int i = 1; i < result.length; i++){
			
			if(i%(1024*43) == 0 || ct){
				result[i] = 127;
				ct = true;
			}else{
				result[i] = 1;
			}
		}
		return result;
	}
	
	public static void main(String[] args){
		load("1.mp3");
		/*
		File out = new File("1.wav");
		FileOutputStream ff = null;
		try {
			ff = new FileOutputStream(out);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			ff.write(t);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
	}
}
